<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 	<title>${title }</title>
	<!--自定义index样式-->
	<link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css"></link>
	<link rel="stylesheet" href="${ctx }/static/styles/edit/box.css"></link>
	<!--js库-->
	<%@ include file="/static/commons/jquery-easyui.jsp" %>
	<script type="text/javascript" src="${ctx}/static/scripts/set_select.js"></script>
	<style type="text/css">
		.normal thead{display: block;max-width:1250px}
		.normal tbody{display: block;max-height: 187px; overflow: hidden; overflow-y: auto; margin-top: -1px;}
		.normal thead tr th{width: 120px; min-width:92px; background: #f1f1f1; text-align: center; font-weight: normal; min-height: 40px; height: 40px; border: 1px solid #666;}
		.normal thead tr th em{color: red;}
		.normal tbody tr td{padding: 2px 0px; width: 120px; min-width:115px; height: 30px; min-height:30px; text-align: center; border: 1px solid #666;}
		.normal .w40{width: 40px; min-width:40px; padding: 0px;}
		.normal input.wd170{padding-left: 5px; width: 95%!important; color: #000;}
		.choose_icon{background: url(${ctx}/static/images/common/choose.png) no-repeat; width: 24px; height: 24px; cursor: pointer;}
	</style>
  </head>
  
  <body style="padding-bottom:8px;overflow: hidden;">
  		<form id="editForm" action="${ctx}/partsOut/save" method="post">
  			<div class="box">
	  			<!-- 被检设备 -->
	  			<table class="normal" id="equTable">
	  				<thead>
	  					<tr>
							<th class="w40">序号</th>
							<th>名${obj }称</th>
							<th>仪器型号</th>
							<th>仪器编号</th>
							<th>设备类型</th>
							<th>气体种类</th>
							<th>生产厂家</th>
							<th>故障现象</th>
							<th>维修配件</th>
							<th>检测员</th>
							<th class="w40">操作</th>
	  					</tr>
	  				</thead>
		        	<tbody>
		        		<c:forEach items="${details }" var="li" varStatus="i">
				        	<tr>
								<td class="w40">${i.index + 1 }<input type="hidden" name="logId" value="${li.log_id }"></input></td>
								<td>${li.device_name }</td>
								<td>${li.device_model }</td>
								<td>${li.device_no }</td>
								<td>${li.device_type_ }</td>
								<td>${empty li.gas_type ? "/" : li.gas_type_}</td>
								<td>${li.device_manufactor }</td>
								<td>${li.fault_name }</td>
								<td class="parts">${li.parts_name }</td>
								<td>${li.repair_user }</td>
								<td class="w40"><div class="choose_icon" title="查看配件明细"></div></td>
							</tr>
						</c:forEach>
					</tbody>
	        	</table>
	    	</div>
    	</form>
	</body>
	<script type="text/javascript">
		$(function() {
			var initBodyScroll = function(){
				var h = 0;
				$('#equTable tbody tr').map(function(){
					return h += $(this).outerHeight(true);
				});
				if(h>187){
					$('#equTable tbody').css('margin-right','-17px');
				}else{
					$('#equTable tbody').css('margin-right','0px');
				}
			};
			initBodyScroll();
			
        	
        	$(document).on('click', '.choose_icon', function(){
        		var pp = parent;
        		var tr_ = $(this).parents('tr');
        		var logId = tr_.find('input[name="logId"]').val();
        		
        		pp.openWindow("查看配件明细",pp.width2,350,"${ctx}/partsOut/viewParts?logId="+logId,[{
					text:'取消',
					iconCls:'icon-no',
					handler:function(){
						pp.closeWindow('winDiv2');
					}
				}],'','winDiv2');
        	});
		});
	</script>
</html>